import request from '@/utils/request'
// 请求商品列表
const fetchCates = (params = {}) => {
  return request.get('/cateLists', { params })
}
// 新增商品分类
const addCate = (params = {}) => {
  return request.post('/addCate', params)
}

// 分类详情用以编辑
const fetchCateDetail = id => {
  return request.get('/getCate', { params: { id } })
}
// 编辑修改商品分类 分层所用
const updateCate = (params = {}) => {
  return request.put('/updateCate', params)
}
// 删除 商品分类
const deleteCate = id => {
  return request.delete('/deleteCate', { params: { id } })
}
export {
  fetchCates,
  deleteCate,
  updateCate,
  addCate,
  fetchCateDetail
}
